﻿//
// Lightbox Gallery Module for DotNetNuke
// Project Contributors - Will Strohl (http://www.WillStrohl.com), Armand Datema (http://www.schwingsoft.com)
//
//Copyright (c) 2009-2013, Will Strohl
//All rights reserved.
//
//Redistribution and use in source and binary forms, with or without modification, are 
//permitted provided that the following conditions are met:
//
//Redistributions of source code must retain the above copyright notice, this list of 
//conditions and the following disclaimer.
//
//Redistributions in binary form must reproduce the above copyright notice, this list 
//of conditions and the following disclaimer in the documentation and/or other 
//materials provided with the distribution.
//
//Neither the name of Will Strohl, Armand Datema, Lightbox Gallery, nor the names of its contributors may be 
//used to endorse or promote products derived from this software without specific prior 
//written permission.
//
//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
//EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 
//OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 
//SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 
//TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 
//BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
//CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 
//DAMAGE.
//


//INSTANT C# NOTE: Formerly VB project-level imports:
using DotNetNuke.Framework;
using System.Data;

namespace WillStrohl.Modules.Lightbox
{

	public abstract class DataProvider
	{

#region  Private Members 

		private const string c_Object = "data";
		private const string c_ObjectType = "WillStrohl.Modules.Lightbox";

#endregion

#region  Shared/Static Methods 

		// singleton reference to the instantiated object 
		private static DataProvider objProvider = null;

		// constructor
		static DataProvider()
		{
			CreateProvider();
		}

		// dynamically create provider
		private static void CreateProvider()
		{
			objProvider = (DataProvider)(Reflection.CreateObject(c_Object, c_ObjectType, c_ObjectType));
		}

		// return the provider
		public static new DataProvider Instance()
		{
			return objProvider;
		}

#endregion

#region  Abstract Methods 

		public abstract int AddLightbox(int ModuleId, string GalleryName, string GalleryDescription, string GalleryFolder, int DisplayOrder, bool HideTitleDescription, int LastUpdatedBy, int GroupId);
        public abstract void UpdateLightbox(int LightboxId, int ModuleId, string GalleryName, string GalleryDescription, string GalleryFolder, int DisplayOrder, bool HideTitleDescription, int LastUpdatedBy, int GroupId);
		public abstract void DeleteLightbox(int LightboxId);
		public abstract IDataReader GetLightboxes(int ModuleId);
		public abstract IDataReader GetLightbox(int LightboxId);
		public abstract IDataReader GetLightboxIds(int ModuleId);
		public abstract int GetLightboxCount(int ModuleId);
		public abstract void UpdateDisplayOrder();
		public abstract bool DoesDisplayOrderNeedUpdate();

		public abstract int AddSetting(int LightboxId, int Padding, int Margin, bool Opacity, bool Modal, bool Cyclic, bool OverlayShow, decimal OverlayOpacity, string OverlayColor, bool TitleShow, string TitlePosition, string Transition, int Speed, int ChangeSpeed, bool ShowCloseButton, bool ShowNavArrows, bool EnableEscapeButton, string OnStart, string OnCancel, string OnComplete, string OnCleanup, string OnClosed);
		public abstract void UpdateSetting(int SettingId, int LightboxId, int Padding, int Margin, bool Opacity, bool Modal, bool Cyclic, bool OverlayShow, decimal OverlayOpacity, string OverlayColor, bool TitleShow, string TitlePosition, string Transition, int Speed, int ChangeSpeed, bool ShowCloseButton, bool ShowNavArrows, bool EnableEscapeButton, string OnStart, string OnCancel, string OnComplete, string OnCleanup, string OnClosed);
		public abstract void DeleteSetting(int SettingId);
		public abstract IDataReader GetSettings(int LightboxId);

		public abstract IDataReader GetImages(int LightboxId);
		public abstract IDataReader GetImageById(int ImageId);
		public abstract IDataReader GetImageByFileName(int LightboxId, string FileName);
		public abstract int AddImage(int LightboxId, string FileName, string Title, string Description, int DisplayOrder, int LastUpdatedBy);
		public abstract void UpdateImage(int ImageId, int LightboxId, string FileName, string Title, string Description, int DisplayOrder, int LastUpdatedBy);
		public abstract void DeleteImageById(int ImageId);
		public abstract void DeleteImageByFileName(int LightboxId, string FileName);
		public abstract int GetImageCount(int LightboxId);

#endregion

	}

}